<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<base href="<%=basePath%>">
<link rel="stylesheet" type="text/css" href="img/style.css"/>
<!--[if lt IE 7]>
<script type="text/javascript" src="img/putaojiayuan.js"></script>
<![endif]-->
<script type="text/javascript" src="img/tab.js"></script>
<script language="javascript" src="js/jquery-1.7.2.min.js"></script>
<script language="javascript" src="js/jquery-ui-1.8.22.custom.min.js"></script>

<script type="text/JavaScript">
var _c = _h = 0;
var picNum=0;
$(document).ready(function () {

    //ajax获取活动广告信息   $.post("ajaxGetAdvertActiveAct!findAdvertActive.action" ,{"id":Math.random()},function(data){
 		// },"json");
    $.post("ajaxGetActiveAdvertAct!getActiveAdvertInfo.action",{"id":Math.random(),"advertId":'8'},function(data){
    	$("#pic").empty();
    	alert(data.length);
    	if(data.length == 1){
    		$("#pic").append("<a href='"+data[0].notes+"'><img  src='uploadAdvertFile/"+data[0].advertPath+"'/></a>");
    	}else{
    		picNum = data.length-2;
        	var picpath = "<div class='img_switch_text'><div class='number_nav'><ul id='play'>";
    			for(var i=0;i<data.length;i++){
    				$("#pic").append("<a href='"+data[i].notes+"'><img  src='uploadAdvertFile/"+data[i].advertPath+"'/></a>");
    				if(i==0){
    					picpath = picpath + "<li value='"+(i+1)+"' style='background:#f00;'>"+(i+1)+"</li>";
    				}else{
    					picpath = picpath + "<li value='"+(i+1)+"' >"+(i+1)+"</li>";
    				}				
    			}
    			picpath = picpath + "</ul></div></div>";
    			$("#pic").append(picpath);  				
      }

			//给显示图片的页数绑定单击事件
	    $('#play  li').click(function(){
	        var i = $(this).val() - 1;
	        //当单击了按钮后重新开始计时
	        clearInterval(_h);
	        _c = i;
	        //play();
	        change(i);       
	    });

	    //给当前显示的图片绑定鼠标移上去的时间  当触发该事件时重新开始计时
	    $("#pic img").hover(function(){clearInterval(_h)}, function(){play()});

	    //默认执行方法 每3秒重新计时
	    play();
	    
    },"json");
    
	  // 给管理员登陆按钮绑定一个提交事件
	  $('#managerLoginBtn').click(function(){
	  	document.userLoginForm.action = "userLoginAct!userLogin.action";
			document.userLoginForm.submit();
	  });

	// 给普通用户登陆按钮绑定一个提交事件
	  $('#commonUserLoginBtn').click(function(){
	  	document.userLoginForm.action = "userLoginAct!commonUserLogin.action";
			document.userLoginForm.submit();
	  });
})

//定义计时间隔及触发的方法
function play()
{
    _h = setInterval("auto()", 3000);
 
}

//改变显示图片
function change(i)
{
    $('#play li').css('background-color','#000000').eq(i).css('background-color','#FF3000').blur();
    $("#pic img").fadeOut('slow').eq(i).fadeIn('slow');
}

//循环显示图片
function auto()
{   
    _c = _c > picNum ? 0 : _c + 1;
    change(_c);
}

</script>
<style type="text/css">
.img_switch {margin:0 auto;WIDTH:1000px;HEIGHT: 261px; overflow:hidden}
.img_switch_content {HEIGHT: 261px;position:relative;}
.img_switch_text {width: 262px;position: absolute;z-index:10; bottom:5px;left:10px;HEIGHT: 15px; z-index:10000 !important}
.number_nav {DISPLAY: inline;FLOAT: left;}
.number_nav UL {font:12px Arial, Helvetica, sans-serif;padding: 0px;MARGIN: 0px;LIST-STYLE-TYPE: none;color:#fff;}
.number_nav UL LI {float: left;font-weight: bold;background: #000;float: left;margin-right: 8px;width: 23px;cursor: pointer;line-height: 17px;height: 17px;text-align: center;filter:alpha(opacity=75);-moz-opacity:0.75;opacity: 0.75;}
#pic {OVERFLOW: hidden}
</style>

	<title>IT人才社区</title>
</head>

<body>
<div class="top">
  <div class="top_bar">
    <div class="logo"></div>
    <div class="at1">
    	<s:if test="#session.nameCn!=null">
    		欢迎${session.nameCn}，回来
    	</s:if>
    	<s:else>
    		游客
    	</s:else>
    </div>
    <div class="clear"></div>
  </div>
  <div class="nav">
    <ul>
      <li><a href="index.jsp">社区首页</a></li>
      <li><a href="indexShow/call.jsp">编程专区</a></li>
      <li><a href="indexShow/tongxun.html">工作专区</a></li>
      <li><a href="indexShow/dongtai2.html">最新动态</a></li>
      <li><a href="indexShow/liuyang.html">留言板</a></li>
      <li class="hover"><a href="indexShow/help.html">帮助中心</a></li>
    </ul>
  </div>
</div>
<form method="post" action="servlet/UserLoginServlet"	name="userLoginForm">
<div class="content">
  <div class="main">
    <div class="container">
    <s:if test="#session.nameCn==null">
      <div class="denglu" id="dengLuId">
        <div class="tabbox">       	
          <div class="menu5">
            <ul>
              <li id="one1" onmouseover="setTab('one',1,2)" class="hover">个人登录</li>
              <li id="one2" onmouseover="setTab('one',2,2)">管理员登录</li>
            </ul>
          </div>
          <div class="con_t1" id="con_one_1">
            <table width="100%" border="0">
            	<tr>
            		<td colspan="2" valign="bottom" style="color: red;" align="left">
									<% Object message = request.getAttribute("messageCommon"); 
	              		if(message == null){
	              			message = "";
	              		}else{
	              			message= "  **" + (String)message; 
	              		}
              		%>
									<span>&nbsp&nbsp<%= message%></span>
								</td>
            	</tr>
              <tr>
                <td width="60" height="40" align="right">用户名&nbsp;</td>
                <td>
                	<s:textfield name="userVoForCommon.userName" theme="simple" cssClass="text2"></s:textfield>
                	<!--<input type="text" name="userVoForCommon.passwd" value="" class="text2" />  -->
                </td>
              </tr>
              <tr>
                <td width="60" height="40" align="right">密&nbsp;&nbsp;码&nbsp;</td>
                <td>
                	<s:password name="userVoForCommon.passwd" theme="simple" cssClass="text2"></s:password>
                	<!-- <input type="password" name="userVoForCommon.userName" value="" class="text2"/>  -->
                </td>
              </tr>
              <tr>
                <td width="60" height="40" align="right">&nbsp;</td>
                <td><div class="c4">
                    <input type="submit" id="commonUserLoginBtn" value="" class="btn2" />
                    &nbsp;
					<a href="jsp/rigester.jsp" style="font-weight:normal; font-size:12px; color:#610007">注册</a>
					&nbsp;<a href="http://www.insigmaedu.com/" style="font-weight:normal; font-size:12px; color:#610007">忘记密码</a>
					</div></td>
              </tr>
            </table>
          </div>
          <div class="con_t1" id="con_one_2" style="display:none">
            <table width="100%" border="0">
            	<tr>
            		<td colspan="2" valign="bottom" style="color: red;" align="left">
									<% Object messageCommon = request.getAttribute("message"); 
	              		if(messageCommon == null){
	              			messageCommon = "";
	              		}else{
	              			messageCommon= "  **" + (String)messageCommon; 
	              		}
              		%>
									<span>&nbsp&nbsp<%= messageCommon%></span>
								</td>
            	</tr>
              <tr>
                <td width="60" height="40" align="right">用户名&nbsp;</td>
                <td>
                	<s:textfield name="userVoForManager.userName" theme="simple" value="zb@163.com" cssClass="text2"></s:textfield>
                	<!-- <input type="text" name="userVoForManager.userName" value="zb@163.com" class="text2" />  -->
                </td>
              </tr>
              <tr>
                <td width="60" height="40" align="right">密&nbsp;&nbsp;码&nbsp;</td>
                <td>
                	<s:password name="userVoForManager.passwd" theme="simple" value="zb@163.com" cssClass="text2"></s:password>               	
                	<!-- <input type="password" name="userVoForManager.passwd" value="zb@163.com" class="text2"/>  -->
                </td>
              </tr>
              <tr>
                <td width="60" height="40" align="right">&nbsp;</td>
                <td><div class="c4">
                    <input type="button" id="managerLoginBtn" class="btn2" />
                    &nbsp;&nbsp;<a href="http://www.insigmaedu.com/">忘记密码</a></div></td>
              </tr>
            </table>
          </div>
        </div>
      </div>
      </s:if>
      <div  class="img_switch">
      <div class="img_switch_content" id="pic"> 
      	<!--  用 jquery 广告显示区域 -->
      </div>
    </div>
    </div>
    <div class="box1">
      <div class="img1"><img src="img/icon4.jpg"  width="122" height="152"/></div>
      <div class="txt">
        <h2><a href="http://www.insigmaedu.com/">下载最新IT免费资料</a></h2>
        <div class="txt2">
          <p>了解有关选项卡和选项卡快捷方式、加速器和浏览的更多信息加速器和浏览的更多信息 </p>
        </div>
        <div class="at2"> <a href="http://www.insigmaedu.com/"><img src="img/btn1.jpg"  width="142" height="39"/></a>
        <span><a href="http://www.insigmaedu.com/">>>了解详情</a></span> </div>
      </div>
      <div class="clear"></div>
    </div>
    <div class="box1">
      <div class="img1"><img src="img/icon3.jpg"  width="122" height="152"/></div>
      <div class="txt">
        <h2><a href="http://www.insigmaedu.com/">下在最新就业信息资料</a></h2>
        <div class="txt2">
          <p>了解有关选项卡和选项卡快捷方式、加速器和浏览的更多信息加速器和浏览的更多信息 </p>
        </div>
        <div class="at2"> <a href="http://www.insigmaedu.com/"><img src="img/btn1.jpg"  width="142" height="39"/></a>
        <span><a href="http://www.insigmaedu.com/">>>了解详情</a></span> </div>
      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
    <div style="background:url(img/bg6.jpg) repeat-x; height:2px; width:100%; margin-bottom:18px; overflow:hidden"></div>
    <div class="box2">
      <h2 class="title1"><img src="img/icon1.jpg" />&nbsp;&nbsp;最新动态</h2>
      <ul class="menu1">
        <li><a href="http://www.insigmaedu.com/">有关Java开发的若干问题 知名专家为你解惑</a><span>00-00-00</span></li>
        <li><a href="http://www.insigmaedu.com/">有关C#技术的崛起 微软的新策略在win8上的应用</a><span>00-00-00</span></li>
        <li><a href="http://www.insigmaedu.com/">有关C++技术的100个陷阱 示例演示性能提升的最佳</a><span>00-00-00</span></li>
        <li><a href="http://www.insigmaedu.com/">3G互联网的提前到来 iPhone/iPad和Android的对决</a><span>00-00-00</span></li>
      </ul>
      <div><a href="http://www.insigmaedu.com/" style="float:right; color:#b05004">>>了解详情</a></div>
    </div>
    <div class="box3">
      <div class="txt3">
        <h2 class="title2"><img src="img/icon2.gif" />&nbsp;&nbsp;客服中心</h2>
        <img src="img/phone.gif" width="198" height="111"/> </div>
      <div class="img2"><a href="http://www.insigmaedu.com/"><img src="img/icon5.gif" width="162" height="158"/></a></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
</form>
<div class="foot">
  <div class="foot_nav"><a href="">帮助中心</a>|<a href="http://www.insigmaedu.com/">隐私条款</a>|<a href="http://www.insigmaedu.com/">关于我们</a></div>
  <div class="foot_bar"><img src="img/logo2.jpg"  width="114" height="42" align="left"/>&copy;2012.INSIGMAEDU Technology Co.Ltd<br />
    浙ICP备08204343</div>
  <div class="clear"></div>
</div>
</body>
</html>

